package com.rocksea.app.entry;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * Created by 吴志华 on 2017/10/20.
 *
 */

public class Selcet implements Parcelable
{
    private String bdName;
    private String gdName;
    private String bdId;
    private String gdId;
    public Selcet()
    {
    }

    protected Selcet(Parcel in) {
        bdName = in.readString();
        gdName = in.readString();
        bdId = in.readString();
        gdId = in.readString();
    }

    public static final Creator<Selcet> CREATOR = new Creator<Selcet>() {
        @Override
        public Selcet createFromParcel(Parcel in) {
            return new Selcet(in);
        }

        @Override
        public Selcet[] newArray(int size) {
            return new Selcet[size];
        }
    };

    public String getBdName() {
        return bdName;
    }
    public void setBdName(String bdName) {
        this.bdName = bdName;
    }
    public String getGdName() {
        return gdName;
    }
    public void setGdName(String gdName) {
        this.gdName = gdName;
    }
    public String getBdId() {
        return bdId;
    }
    public void setBdId(String bdId) {
        this.bdId = bdId;
    }
    public String getGdId() {
        return gdId;
    }
    public void setGdId(String gdId) {
        this.gdId = gdId;
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(bdName);
        dest.writeString(gdName);
        dest.writeString(bdId);
        dest.writeString(gdId);
    }

    @Override
    public boolean equals(Object obj)
    {
        Selcet other = (Selcet) obj;
        if (this.getGdName()!=null)
        {
            //工点
            return this.getGdName().equals(other.getGdName());
        }
        else
        {
            //标段
            return this.getBdName().equals(other.getBdName());
        }
    }
}
